/* Copyright (c) 2006 celumsolutions. All Rights Reserved. */
package com.swingolf.model;

import org.hibernate.validator.constraints.NotEmpty;

import javax.validation.constraints.*;

/**
 * @author rtm
 * @since 14.09.11
 */
public class Tournament {

  private Long id;

  @NotNull @Size(min = 3) @NotEmpty
  private String name;

  public Tournament() {
  }

  public Tournament(long id, String name) {
    this.id = id;
    this.name = name;
  }

  public void setId(Long id) {
    this.id = id;
  }

  public Long getId() {
    return id;
  }

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;

    Tournament player = (Tournament) o;

    if (id != null ? !id.equals(player.id) : player.id != null) return false;

    return true;
  }

  @Override
  public int hashCode() {
    return id != null ? id.hashCode() : 0;
  }
}


